/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author edilson
 */
@Entity
@Table(name = "Disciplina")
public class Disciplina implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    
//    @Column(name = "ch")
//    private Integer ch;
    
    @Column(name = "nome")
    private String nome;
    
//    @JoinColumn(name="professor", referencedColumnName="id")
//    @ManyToOne
//    Professor professor;
//    @OneToMany(mappedBy = "disciplina")
//    private List<Turma> turmas;
//    @OneToMany(mappedBy = "disciplina", fetch=FetchType.EAGER)
//    private List<Ementa> ementas;
    
//    @OneToMany(mappedBy = "disciplina")
//    private List<ListaDisciplina> listaDisciplinas;
//    @OneToMany(mappedBy = "disciplina")
//    private List<DisciplinaProfessor> disciplinaProfessors;

    public Disciplina() {
    }

    public Disciplina(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Disciplina)) {
            return false;
        }
        Disciplina other = (Disciplina) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Disciplina[id=" + id + "]";
    }

}
